<template>
	<view class="" v-if="pageShow">
		<view class="lbnox">
			<view class="dingwei flexcenter">
				<image class="huiyuantb" :src="dataAll.logo_text" mode=""></image>
				<!-- <image class="biaoshi" src="../static/image/system/biaos.png" mode=""></image> -->
			</view>
			<view class="xiaobai titletext fonweight margin_top2 textcenter">{{dataAll.name}}</view>
		</view>
		<!--内容  -->
		<view class="" style="position: relative; top: -50rpx;">
			<!--  个人简介-->
			<view class="block mainpadding ffffff">
				<view class="xiaohei sanshier fonweight ">个人简介</view>
				<view class="xiaohui ershiba nofonweight margin_top1">{{dataAll.des}}</view>
				<view class="flexleft flex_wrap">
					<view class="sanshis flexcenter " v-for="item in dataAll.images_text" @click="lbtpriview(index,dataAll.images_text)">
						<image class="jiaolt margin_top" :src="item" mode=""></image>
					</view>
				</view>
			</view>
			<!--  基本资料-->
			<view class="mainpadding ffffff margin_top1">
				<view class="sanshier fonweight xiaohei">基本资料</view>
				<view class="flexleft margin_top">
					<view class="ershiba nofonweight xiaohei zitikd">姓名：</view>
					<view class="ershiba nofonweight xiaohui ">{{dataAll.name}}</view>
				</view>
				<view class="flexleft margin_top2">
					<view class="ershiba nofonweight xiaohei zitikd">性别：</view>
					<view class="ershiba nofonweight xiaohui ">{{dataAll.gender==1?"男":"女"}}</view>
				</view>
				<view class="flexleft margin_top2">
					<view class="ershiba nofonweight xiaohei zitikd">电话：</view>
					<view class="flexbetween" @click="phone(dataAll.mobile)">
						<view class="ershiba nofonweight xiaohui ">{{dataAll.mobile}}</view>
						<u-icon name="phone"></u-icon>
					</view>
				</view>
				<view class="flexleft margin_top2">
					<view class="ershiba nofonweight xiaohei zitikd">年龄：</view>
					<view class="ershiba nofonweight xiaohui ">{{dataAll.age}}</view>
				</view>
				<view class="flexleft margin_top2">
					<view class="ershiba nofonweight xiaohei zitikd">所属机构：</view>
					<view class="ershiba nofonweight xiaohui ">{{dataAll.cginfo.name}}</view>
				</view>
				<view class="flexleft margin_top2">
					<view class="ershiba nofonweight xiaohei zitikd">证书编号：</view>
					<view class="ershiba nofonweight xiaohui ">{{dataAll.zscode}}</view>
				</view>
				<view class="flexcolumn margin_top2">
					<view class="ershiba nofonweight xiaohei zitikd">教练证书：</view>
					<image :src="dataAll.yyzz_image_text" @click="lbtpriview(0,[dataAll.yyzz_image_text])" class="margin_top" style="width: 100%;height: 350rpx;" mode=""></image>
				</view>
			</view>
			<!-- <view class="mainpadding ffffff margin_top1">
				<view class="sanshier fonweight xiaohei">负责课程</view>
				<view class="lvbox margin_top2">
					<view class="ershiba nofonweight xiaohei">游泳课</view>
					<view class="flexbetween">
						<view class="ershil nofonweight xiaohui">总课时：10</view>
						<view class="ershil nofonweight xiaohui">已上课时：10</view>
						<view class="ershil nofonweight xiaohui">学生数量：10</view>
					</view>
				</view>
			</view> -->
			<view class="mainpadding ffffff margin_top1" v-if="dataAll.bq_names_text.length">
				<view class="xiaohei fonweight sanshier">标签</view>
				<view class="flexleft flex_wrap">
					<view class="lvbtn margin_top2 margin_right1" v-for="(item,index) in dataAll.bq_names_text"
						:key="index">{{item}}</view>
				</view>
			</view>
			<!--更多课程  -->
			<view class="mainpadding ffffff margin_top1">
				<view class="flexbetween" @click="tzgdkc">
					<view class="sanshier fonweight xiaohei">更多课程</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
				<view class="xiahuaxian margin_top" v-for="item in kcList" :key="item.id" @click="tzkecxq(item.id)">
					<view class="flexbetween">	
						<view class="shilitu">
							<image :src="item.image_text" mode=""></image>
						</view>
						<view class="" style="width: 69%;">
							<view class="titletext xiaohei fonweight yhxk">{{item.name}} </view>
							<view class="flexleft margin_top2">
								<view class="smalltext xiaohui nofonweight margin_right2">{{item.userzbfapply.name}}
								</view>
								<view class="line margin_right2"></view>
								<view class="smalltext xiaohui nofonweight yhxk">{{item.cityinfo}}
								</view>
							</view>
							<view class="flexbetween margin_top2">
								<view class="sanshier xiaohong fonweight">¥ {{item.priceinfo.price}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- 所属场地 -->
			<view class="mainpadding ffffff margin_top1" v-if="cgList.length">
				<view class="flexbetween">
					<view class="sanshier fonweight xiaohei">所属场地</view>
					<!-- <u-icon name="arrow-right"></u-icon> -->
				</view>
				<view class="xiahuaxian margin_top" v-for="item in cgList" :key="item.id" @click="jumpurl('/pages_homepage/changguanjieshao?id=',item.user_zbfapply_id)">
					<view class="flextop">
						<view class="shilitu">
							<image :src="item.userzbfapply.logo_text" mode=""></image>
						</view>
						<view class="flexcolumnbet" style="width: 69%;height: 160rpx;">
							<view class="titletext xiaohei fonweight yhxk">{{item.userzbfapply.name}}</view>
							<view class="flexleft margin_top6">
								<!-- <view class="smalltext xiaohui nofonweight margin_right2">300米</view> -->
								<!-- <view class="line margin_right2"></view> -->
								<view class="smalltext xiaohui nofonweight yhxk">{{item.userzbfapply.cityinfo}}{{item.userzbfapply.address}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")

	export default {
		data() {
			return {
				dataAll: {},
				listid: "",
				pageShow: false,
				cgList:[],
				kcList:[]
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getDetail()
			this.getlist()
			this.getlistkc()
		},
		methods: {
			// 跳转课程详情
			tzkecxq(id) {
				uni.navigateTo({
					url: '/pages_homepage/kechenggmxq?id=' + id
				})
			},
			jumpurl(url,id){
				uni.navigateTo({
					url:url+id
				})
			},
			getDetail() {
				httpRequest.request('/api/user/jlbDetail', 'GET', {
					user_zbfapply_id: this.listid
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			getlistkc(){//更多课程
				httpRequest.request('/api/kccl/kcIndex', 'GET', {
					page:1,
					limit:3,
					jl_user_zbfapply_id: this.listid
				}, false, false, true).then(res => {
					this.kcList = res.data.data
				})
			},
			getlist(){//关联场馆
				httpRequest.request('/api/user/jlGlCg', 'GET', {
					user_zbfapply_id: this.listid
				}, false, false, true).then(res => {
					this.cgList = res.data
				})
			},
			lbtpriview(index, arr) {
				var i = arr; //获取当前页面的轮播图数据
				//uniapp预览轮播图
				uni.previewImage({
					current: index, //预览图片的下标
					urls: i //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
				})
			},
			// 跳转课程详情
			tzkcxq() {
				uni.navigateTo({
					url: '/pages_homepage/kechengxq'
				})
			},
			// 跳转所属场地
			tzsscd() {
				uni.navigateTo({
					url: '/pages_homepage/suoshuchangd'
				})
			},
			// 跳转更多课程
			tzgdkc() {
				uni.navigateTo({
					url: '/pages_homepage/gengduokecheng?type=1&id='+this.listid
				})
			},
			phone(p){
							uni.makePhoneCall({
									phoneNumber: p.toString()
								}).catch((e) => {
									// console.log(e)  //用catch(e)来捕获错误{makePhoneCall:fail cancel}
							   })
						}
		}
	}
</script>

<style lang="scss" scoped>
	.line {
		width: 2rpx;
		height: 24rpx;
		background: #EEEEEE;
	}
.lvbtn {
		background: #DFFFED;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		padding: 6rpx 10rpx;
		font-size: 20rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #1BA95B;
	}
	.xiaolvbtn {
		width: 112rpx;
		height: 56rpx;
		background: #1BA95B;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		font-size: 26rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.shilitu {
		width: 200rpx;
		height: 160rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.lvbox {
		padding: 24rpx 20rpx;
		background: #EFFFF6;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.zitikd {
		width: 200rpx;
	}

	.menlc {
		width: 210rpx;
		height: 210rpx;
		position: absolute;
		bottom: 0rpx;
		right: 12rpx;
		border-radius: 16rpx;
		background-color: hsla(0, 0%, 0%, .3);
	}

	.fudsp {
		position: absolute;
		bottom: 84rpx;
		left: 84rpx;
		width: 40rpx;
		height: 40rpx;
		z-index: 1;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.jiaolt {
		width: 210rpx;
		height: 210rpx;
	}

	.block {
		border-radius: 16rpx 16rpx 0rpx 0rpx;
	}

	.huiyuantb {
		width: 132rpx;
		height: 132rpx;
		border-radius: 50%;
	}

	.biaoshi {
		width: 32rpx;
		position: absolute;
		right: 304rpx;
		bottom: 14rpx;
		height: 32rpx;
	}

	.lbnox {
		padding: 60rpx 30rpx 80rpx;
		background: linear-gradient(180deg, #1BA95B 0%, #94d7b2 100%);
	}

	page {
		background-color: #F9F9F9;
	}
</style>